Skip to content

feat(harbor): a QUEUE panel with FIRST, priority and DROP for a paired device - #325

Merged
T-Crypt merged 1 commit into
nextfrom
T-Crypt/harbor-queue
Nov 13, 2026
Merged

T-Crypt merged 1 commit into
nextfrom
T-Crypt/harbor-queue

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Why

Berth Next milestone 7b, operator override, harbor part. #324 added berth queue on the CLI. The plan asks for the
same buttons in the harbor, so the operator can reorder the queue from a phone.

What changes

  • POST /v1/board/queue takes {"lease","action","priority"}. It runs writeOK (same-origin, X-Berth: 1, a
    paired device), checks the body, then sends OpQueue to berthd's socket with h.ask.
    • It answers 200 with the change, 409 with berthd's refusal, or 400 for a bad body.
    • It is added to writePaths.
  • No gateway route, on purpose. The gateway's /v1/berth/* routes accept the node API key, and agents hold that
    key. A gateway route would let an agent bump its own requests. Only a paired device can change the queue.
  • The SWITCH tab gets a QUEUE panel (and a subnav entry) built from /v1/status waiting, or demo.json in demo
    mode.
    • Each row shows its place, its holder, a priority chip and its lease ID and wait time.
    • A paired device gets FIRST (disabled at the head of the queue), a priority <select> and DROP. A training or
      a hold gets no controls.
    • .sw-prio styles the select like .btn.

Proof

  • TestBoardQueue runs a real broker behind the harbor with a pinned game and two waiters.
    • An unpaired bump gets 401 and leaves the queue alone.
    • A paired bump answers 200 with the change and reorders the real queue.
    • Three bad bodies get 400, prio hold gets 409, and a paired drop refuses the waiter with the operator's
      reason.
    • The fake gateway sees no request at all.
  • The existing TestBoardActionGates and TestBoardActionForwards pass with the split brokerHarbor helper.
  • Looked at with headless Firefox on the demo fixtures, at 1280 px and 390 px. Two waiters show in order. FIRST is
    disabled on the first row. The picker matches the buttons once .sw-prio is added (before that it was the
    browser's white control). At 390 px DROP wraps to its own line and keeps touch size.
  • proof.sh full passes.

…d device

The SWITCH tab lists the waiters in grant order from the node's status. A
paired device gets FIRST (bump), a priority picker and DROP on each one,
except for a training or a hold, which the broker refuses to change.

POST /v1/board/queue goes from the harbor straight to berthd's socket after
the pairing check. There is no gateway route on purpose: agents hold the
gateway's API key, and a queue change is the operator's.
@T-Crypt
T-Crypt merged commit 2391a9b into next Nov 13, 2026
2 checks passed
@T-Crypt
T-Crypt deleted the T-Crypt/harbor-queue branch November 13, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant